package org.zoomdev.zoom.web.action.impl;

import org.zoomdev.zoom.web.action.ActionHandler;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public final class ServletActionHandler extends ActionHandler {

    private final HttpServlet servlet;

    public ServletActionHandler(String key, String[] methods, String[] pathVariableNames, HttpServlet servlet) {
        super(key, methods, pathVariableNames);
        this.servlet = servlet;
    }

    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response) throws Throwable {
        servlet.service(request, response);
    }
}
